package com.langchao.controller;

import com.langchao.Service.LoginService;
import com.langchao.domain.dto.ResultObject;
import com.langchao.domain.pojo.MyPage;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


@RestController
@RequestMapping("/system/users")
public class LoginController {
    @Autowired
    private LoginService loginService;

    @PostMapping("/login")
    //1.接受参数
    public ResultObject findLangchaoUserByPage(@RequestBody MyPage myPage) {

        //2.转发请求
        ResultObject langchaoUsers = loginService.findLangchaoUserByPage(myPage);
        //3.返回请求
        return langchaoUsers;//1.我们查询到的分页数据，2，返回信息。3.boolean 查询成功与否
    }

}
